﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using KinonekoSoftware.CodariaDB;
using KinonekoSoftware.CodariaDB.Documents.Index;
using KinonekoSoftware.Studio.Pages.Galleries;
using Microsoft.Xaml.Behaviors;

namespace KinonekoSoftware.Studio.Pages.Galleries
{
    [Associate(View = typeof(ModernListGalleryView), ViewModel = typeof(ModernListGalleryViewModel))]
    [Associate(View = typeof(ModernListGalleryView), ViewModel = typeof(WeaponGalleryViewModel))]
    public partial class ModernListGalleryView
    {
        public ModernListGalleryView()
        {
            InitializeComponent();
        }

        protected override void OnViewModelMessaging(object parameter)
        {
            //var vm   = ViewModel<InstanceGalleryViewModel>();
            //var list = ViewModel<ListGalleryViewModel>();
            //if (parameter is null)
            //{
            //    var selected   = (vm?.CurrentSelected ?? list?.CurrentSelected);
            //    var isSelected = selected is not null;
                
            //    OpenButton.IsEnabled =
            //            LockAndUnlockButton.IsEnabled =
            //            ExportButton.IsEnabled = 
            //                RemoveButton.IsEnabled = isSelected;

            //    if (isSelected)
            //    {
            //        var g = selected.IsLocked ? "FeatherIcon.Lock" : "FeatherIcon.Unlock";
            //        LockAndUnlockButton.Icon = FindResource(g) as Geometry;
            //    }
            //}

            //if (parameter is not null)
            //{
            //    NextPageButton.IsEnabled     = vm.CanNextPage();
            //    PreviousPageButton.IsEnabled = vm.CanPreviousPage();
            //}
        }
    }
}